import { ADD } from './constants'
// 1. 定义reducer函数
export default function reducer(
  state = { count: 10, msg: '213', xxx: 234 },
  action
) {
  switch (action.type) {
    case ADD:
      return {
        ...state,
        count: state.count + action.num,
      }
    default:
      return state
  }
}
